/**
 * 
 */

function arrayinit()
{
	/*
	 * document.getElementById('resultDiv').onclick=function();
	 */
	f = document.frm;
	arr = new Array(1);
	cnt = 0;
	rst = document.getElementById('resultDiv');
	var btnadd = document.getElementById('btnadd');
	var btnview = document.getElementById('btnview');
	var btnsort = document.getElementById('btnsort');
	btnadd.onclick = function()
	{
		arr[cnt]=f.data.value;
		cnt++;
	}
	btnview.onclick = function()
	{
		rst.innerHTML = '';
		f.result.value = '';
		rst.innerHTML += arr;
		f.result.value += arr;
	}
	btnsort.onclick = function()
	{
		arr.sort(arrasc);
	}
}
function arrasc(a,b)
{
	if(a>b) return 1;
	if(a<b) return -1;
	if(a==b) return 0;
}